#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>


int NumberOf1(int n) {
    int count = 0;
    while (n)
    {
        n = n & (n - 1);
        count++;
    }
    return count;
}

int main()
{
    int n;
    scanf("%d", &n);
    printf("%d\n", NumberOf1(n));
    return 0;
}